<?php
global $Config;
require_once($Config->WebCMSRoot.'Base/View.php');

Class TicketView extends BaseView
{
	function TicketView()
	{
		parent::BaseView();
	}
	
	function ShowConfirmationSuccess()
	{
		$this->output  = '<h2>Bevestiging</h2>';
		$this->output .= '<p>';
		$this->output .= 'Uw code werd met succes geverifieerd.';
		$this->output .= '</p>';
	}
	
	function ShowTicketAlreadyRegistered()
	{
		$this->output .= '<p>';
		$this->output .= 'Uw reservatie is al geboekt.';
		$this->output .= '</p>';
	}
	
	function ShowTicketAlreadyConfirmed()
	{
		$this->output  = '<h2>Bevestiging</h2>';
		$this->output .= '<p>';
		$this->output .= 'Uw reservatie is reeds geverifieerd.';
		$this->output .= '</p>';
	}
	
	function ShowNoConfirmationExists()
	{
		$this->output  = '<h2>Bevestiging</h2>';
		$this->output .= '<p>';
		$this->output .= 'Uw bevestigingscode bestaat niet of is ongeldig.';
		$this->output .= '</p>';
	}
	
	function ShowConfirmationCodeForm()
	{
		$this->output = '<h2>Bevestiging</h2>';

		$this->output .= '<form method="post" action="'.$_SERVER['SCRIPT_NAME'].'">';
		$this->output .= '<p class="formField">';
		$this->output .= '<span class="formFieldLabel"><label for="code">Bevestigingscode:</label></span>';
		$this->output .= '<input type="text" class="formFieldEntry" id="code" name="code" size="40" />';
		$this->output .= '</p>';
		$this->output .= '<p class="formField">';
		$this->output .= '<span class="formFieldLabel">&nbsp;</span>';
		$this->output .= '<input type="submit" class="formFieldEntry" id="btnSubmit" name="btnSubmit" value="Bevestig" />';
		$this->output .= '</p>';

		$this->output .= '</form>';
	}

	function ClientSideTemplates()
	{
		$templates = array(
			'ticket' => array(
				'overview' => '<div class="ticketItem" id="[$ID$]">'.
							  '<div class="value name">[$Name$]</div>'.
							  '<div class="value tickets">[$Tickets$]</div>'.
							  '<div class="value status">[$Status$]</div>'.
							  '<div class="ticketRow ticketR1">'.
							  '<div class="ticketName">[$Name$]</div>'.
							  '<div class="ticketTickets">Tickets: [$Tickets$]</div>'.
							  '<div class="ticketStatus">Status: [$Status$]</div>'.
							  '<div class="ticketDetails"><a href="#" class="detailsLink">Details</a></div>'.
							  '</div>'.
							  '<div class="details">'.
							  '<div class="ticketRow ticketR2">'.
							  '<div class="ticketEmail"><a href="mailto:[$Email$]">[$Email$]</a></div>'.
							  '<div class="ticketAddress">[$Address$]</div>'.
							  '<div class="ticketCity">[$City$]</div>'.
							  '</div>'.
							  '<div class="ticketRow ticketR3">'.
							  '<div class="ticketCreated">Gereserveerd: [$Created$]</div>'.
							  '<div class="ticketConfirmed">Bevestigd: [$Confirmed$]</div>'.
							  '<div class="ticketCode">Code: [$Code$]</div>'.
							  '</div>' .
							  '<div id="ticketDetails" class="ticketRow">' .
							  '<ul>' .
							  '<li>[$opvoering1_label$]: [$opvoering1$]</li>' .
							  '<li>[$opvoering2_label$]: [$opvoering2$]</li>' .
							  '<li>[$opvoering3_label$]: [$opvoering3$]</li>' .
							  '<li>[$opvoering4_label$]: [$opvoering4$]</li>' .
							  '</ul>' .
							  '</div>'.
							  '<div class="ticketRow ticketActions">'.
							  '<a href="#" onClick="Reservaties_Action(this, \'[$nextAction$]\')" class="[$nextAction$]">[$nextAction_label$]</a>'.
							  '<a href="#" onClick="Reservaties_Action(this, \'cancel\')" class="[$nextAction$]">Annuleer</a>'.
							  '</div>'.
							  '</div>',
				'overview_header' => '<div class="ticketHeader">'.
							  '<div class="ticketRow ticketHeader">'.
							  '<div class="ticketName"><a href="#" class="name">Naam</a></div>'.
							  '<div class="ticketTickets"><a href="#" class="tickets">Tickets</a></div>'.
							  '<div class="ticketStatus"><a href="#" class="status">Status</a></div>'.
							  //'<div class="ticketDetails"><a href="#">Exporteren</a></div>'.
							  '</div>'.
							  '</div>',
				'overview_filter' => '<div class="ticketHeader">'.
							  '<div class="ticketRow ticketFilter">'.
							  '<div class="ticketName"><input type="text" class="name" /></div>'.
							  '<div class="ticketTickets"><input type="text" class="tickets" /></div>'.
							  '<div class="ticketStatus"><input type="text" class="status" /></div>'.
							  '<div class="ticketDetails"></div>'.
							  '</div>'.
							  '</div>'/*,
				'edit' => '<div class="edit_item form">'.
						  '<div class="formFieldLabel"><label for="contentKey">Key:</label></div>'.
						  '<div class="formFieldEntry"><input type="text" value="[$Key$]" id="contentKey" name="contentkey" maxlength="100" size="50" /></div>'.
						  '<textarea id="contentHTML" name="contentHTML" class="fck" cols="50" rows="6">[$Content$]</textarea>'.
				          '<div class="overview_actions">'.
						  '<a href="#" onClick="Content_Overview()">Annuleren</a> '.
						  '<a href="#" onClick="Content_Save([$ID$])">Opslaan</a> '.
						  '<a href="#" onClick="confirm(\'Bent u zeker dat u \\\'[$Key$]\\\' \\n\\nwilt verwijderen?\', function() { Content_Delete_Item([$ID$]); } )" id="btnContent_Edit_Delete">Verwijderen</a> '.
						  '</div>',
						  '</div>',
				'photos' => '<div class="edit_item form">'.
						    '<h2>[$Title$]</h2>'.
						    '[$Description$]<br /><br />'.
						    '<div>{#template_koopje_images#}</div>'.
				            '<div class="overview_actions">'.
						    '<a href="#" onClick="Content_Overview()">Annuleren</a> '.
						    '<a href="#" onClick="Content_Photo_Add([$ID$], adminRoot + \'koopjes/imageUpload/[$ID$]\')">Toevoegen</a> '.
						    '</div>',
						    '</div>',
				'thumbnail' => '<div class="edit_thumbnail">'.
						  '<img s_rc="[$Thumbnail$]" alt="[$File$]" /><br />'.
						  '[$File$]'.
						  '</div>',
				'managephotos' => '<div class="edit_thumbnail">'.
						  '<img s_rc="[$Thumbnail$]" alt="[$File$]" /><br />'.
						  '[$File$]<br />'.
						  '<a href="#" class="button" onClick="confirm(\'Bent u zeker dat u deze foto wilt verwijderen?\', function() { Content_Photos_Delete([$ID$], [$_parentID$]); } )">Verwijder</a>'.
						  '</div>'*/
			)
		);
		$this->JsonOutput($templates);
	}
}
?>